<?php

namespace App\Models;

use Dcat\Admin\Traits\HasDateTimeFormatter;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Database\Eloquent\Model;

class ZiliaoCategory extends Model
{
	use HasDateTimeFormatter;
    use SoftDeletes;

    protected $table = 'ziliao_categories';


    public function getExtraAttribute($process)
    {
        return array_values(json_decode($process, true) ?: []);
    }

    public function setExtraAttribute($process)
    {
        $this->attributes['process'] = json_encode(array_values($process));
    }

}
